$buttonMargin: 20px;

scroll-to-top-button-container {
  display: none;
  z-index: 2147483647;
  flex-direction: column;
  flex-wrap: nowrap;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0;
  background-color: transparent !important;
  border: 0;
  pointer-events: none;
}

scroll-to-top-button-container:not( [style*="background-color:"] ) { /* “Band-aid” for blog.webtor.io/en/post/ */
  background-color: transparent !important;
}

scroll-to-top-button-container[data-state-active] {
  display: flex;
}

/** @todo Use logical properties and flow-relative values. https://github.com/csstools/postcss-logical */

scroll-to-top-button-container[data-position-vertical="top"] {
  justify-content: flex-start;
  margin-top: $buttonMargin;
}

scroll-to-top-button-container[data-position-vertical="center"] {
  justify-content: center;
}

scroll-to-top-button-container[data-position-vertical="bottom"] {
  justify-content: flex-end;
  margin-bottom: $buttonMargin;
}

scroll-to-top-button-container[data-position-horizontal="left"] {
  align-items: flex-start;
  margin-left: $buttonMargin;
}

scroll-to-top-button-container[data-position-horizontal="center"] {
  align-items: center;
}

scroll-to-top-button-container[data-position-horizontal="right"] {
  align-items: flex-end;
  margin-right: $buttonMargin;
}

/* Hide from print view */

@media print {

  scroll-to-top-button-container {
    display: none !important;
  }
}
